(function () {


    type myType = {
        name: string,
        age: number,
    }

    // type 无法定义多个重名
    // type myType = {
    //     gender: string
    // }

    const obj: myType = {
        name: 'xxx',
        age: 11
    }

    // 定义一个类结构
    interface myInterface {
        name: string,
        age: number,
    }
    // 定义一个重复的接口，实现扩展
    interface myInterface {
        gender: string
    }

    const obj1: myInterface = {
        name: 'xxx',
        age: 11,
        gender: 'male'
    }

    // 定义个接口，实现抽象类
    interface myInter {
        name: string
        sayHello(): void
    }

    // 定义类实现接口
    class myClass implements myInter {
        name = 'xxx'
        sayHello() {
            console.log('hello')
        }
    }

    // 定义对象实现接口
    const obj2: myInter = {
        name: 'xxx',
        sayHello() {
            console.log('hello')
        }
    }
})();
